<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工管理</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap-theme.min.css">
<script src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/common/bootstrap/js/bootstrap.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/common/bootstrapvaildator/js/bootstrapValidator.min.js"></script>
<script	src="${pageContext.request.contextPath }/js/common/bootstrapvaildator/js/language/zh_CN.js"></script>
</head>
<body>
<body style="margin: 30px;">
		<center>
			<form action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_shop_user1" method="post" name="myform" id="myform">
				<table>
					<tr align="center">
						<td align="right">
							<div class="form-group">
								<label for="account">员工账号：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="text" class="form-control" id="account" name="account" value="${account }">
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="username">姓名：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="text" class="form-control" id="username" name="username" value="${username }">
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="post_code">职位：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<select class="form-control" name="post_code" id="post_code">
									<option value="" selected="selected">请选择~！</option>
									<c:forEach items="${list3 }" var="list3">
										<option value="${list3.post_code }">${list3.post_name }</option>
									</c:forEach>
								</select>
							</div>
						</td>
						<!-- 表单按钮组 -->
						<td rowspan="2">
							<button class="btn btn-primary btn-sm" type="submit" name="zjjinquiry" id="zjjinquiry">
								<span class="glyphicon glyphicon-search" aria-hidden="true"></span>&nbsp;&nbsp;查询
							</button> &nbsp;&nbsp;
							<button class="btn btn-primary btn-sm" type="button" name="zjjresetting" id="zjjresetting">
								<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;&nbsp;重置
							</button>
						</td>
					</tr>
					<tr align="center">
						<td align="right">
							<div class="form-group">
								<label for="work_number">工号：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="text" class="form-control" id="work_number" name="work_number" value="${work_number }">
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="mobile">手机：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="text" class="form-control" id="mobile" name="mobile" value="${work_number }">
							</div>
						</td>
						<td align="right">
							<div class="form-group">
								<label for="entry_date">入职时间：</label>
							</div>
						</td>
						<td align="left">
							<div class="form-group">
								<input type="date" class="form-control" id="entry_date1" name="entry_date1" value="<f:formatDate value='${entry_date1 }' pattern='yyyy-MM-dd'/>">
								至
								<input type="date" class="form-control" id="entry_date2" name="entry_date2" value="<f:formatDate value='${entry_date2 }' pattern='yyyy-MM-dd'/>">
							</div>
						</td>
					</tr>
				</table>
			</form>
			<table class="table table-bordered table-condensed table-hover" width="100%">
				<tr align="center">
					<td></td>
					<td>照片</td>
					<td>姓名</td>
					<td>员工账号</td>
					<td>性别</td>
					<td>工号</td>
					<td>职位</td>
					<td>手机</td>
					<td>入职时间</td>
					<td>操作</td>
				</tr>
				<c:forEach items="${info.list }" var="list" varStatus="s">
					<tr align="center">
						<td>${s.index+1 }</td>
						<td><img src="/bsc${list.photo }" width="120px" height="100px"/></td>
						<td>${list.username }</td>
						<td>${list.account }</td>
						<%-- <td>${list.sex }</td> --%>
						<td><c:if test="${list.sex==1 }">
									男
								</c:if> <c:if test="${list.sex==2 }">
									女
								</c:if> <c:if test="${list.sex==3 }">
									保密
								</c:if></td>
						<td>${list.work_number }</td>
						<td>${list.post_name }</td>
						<td>${list.mobile }</td>
						<%-- <td>${list.entry_date }</td> --%>
						<td><f:formatDate value="${list.entry_date }" pattern="yyyy-MM-dd" /></td>
						<td>
							<a href="${pageContext.request.contextPath }/proltal/zjj1/findByIdBis_shop_user1/${list.shop_user_id}">
								<button type="button" class="btn btn-primary btn-xs">
									<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>&nbsp;&nbsp;详情
								</button>
							</a>
						</td>
					</tr>
				</c:forEach>
			</table>
			
			<!-- 分页 -->
			<a href="#" onclick="first()">首页</a>
			&nbsp;&nbsp;&nbsp;
			<a href="#" onclick="pre()">上一页</a>
			&nbsp;&nbsp;&nbsp;
			<a href="#" onclick="next()">下一页</a>
			&nbsp;&nbsp;&nbsp;
			<a href="#" onclick="last()">尾页</a>
		</center>
</body>
</html>
<script type="text/javascript">
	//条件查询定值方法
	$(function(){
		$("#post_code").val('${post_code}');
	})

	//分页
	//首页
	function first(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_shop_user1?page=${info.firstPage}";
		document.forms[0].submit();lase
	}
	//上一页
	function pre(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_shop_user1?page=${info.prePage}";
		document.forms[0].submit();
	}
	//下一页
	function next(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_shop_user1?page=${info.nextPage}";
		document.forms[0].submit();
	}
	//尾页
	function last(){
		document.forms[0].action="${pageContext.request.contextPath }/proltal/zjj1/selectBis_shop_user1?page=${info.lastPage}";
		document.forms[0].submit();
	}
	
	$("#zjjresetting").click(
		function() {
			$("#account").val("");
			$("#username").val("");
			$("#post_code").val("");
			$("#work_number").val("");
			$("#mobile").val("");
			$("#entry_date1").val("");
			$("#entry_date2").val("");
		}
	);
</script>